<?php

	$arg = @$_REQUEST['arg'];

	include_once("_args.php");

	$arrCommands = getCommands();

	$argname = "";
	$argdesc = "";
	$argparam = "";
	$argexample = "";
	$argauthor = "";
	$argsite = "";

	$bFound = false;
	foreach($arrCommands as $command)
	{
		if ($command[0] == $arg)
		{
			$argname = $command[1];
			$argdesc = $command[2];
			$argparam = $command[3];
			$argexample = $command[4];
			$argauthor = $command[5];
			$argsite = $command[6];
			$bFound = true;
		}
	}

	if (!$bFound)
	{
		@session_start();
		$access_token = $_SESSION['access_token'];
		$arrCommands = getUserCommands($access_token['user_id']);

		foreach($arrCommands as $command)
		{
			if ($command[0] == $arg)
			{
				$argname = $command[1];
				$argdesc = $command[2];
				$argparam = $command[3];
				$argexample = $command[4];
				$argauthor = $command[5];
				$argsite = $command[6];
			}
		}

	}
?>

<table>
<tr>
	<td></td><td><h1 id="centertitle"><?php echo $arg; ?></h1></td>
</tr>
<tr>
	<td align="right" id="listingtitle">Name:</td><td><?php echo $argname; ?></td>
</tr>
<tr>
	<td align="right" id="listingtitle">Description:</td><td><?php echo $argdesc; ?></td>
</tr>
<tr>
	<td align="right" id="listingtitle">Parameter:</td><td><?php echo $argparam; ?></td>
</tr>
<tr>
	<td align="right" id="listingtitle">Example:</td><td><?php echo $argexample; ?></td>
</tr>
<tr>
	<td align="right" id="listingtitle">Author:</td><td><?php echo $argauthor; ?></td>
</tr>
<tr>
	<td align="right" id="listingtitle">Website:</td><td><a href="<?php echo $argsite; ?>"><?php echo $argsite; ?></a></td>
</tr>

</table>
